package com.fast.linkbeanadmin.security.impl;

import com.fast.linkbeanadmin.service.SysUserService;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ruan cai yuan
 * @version 1.0
 * @fileName com.fast.linkbeanadmin.security.impl.UserDetailsServiceImpl
 * @description: TODO
 * @since 2024/7/21 下午6:44
 */
@Component
public class UserDetailsServiceImpl implements UserDetailsService {
    @Resource
    private SysUserService userService;

    /**
     * UserDetails,可以用User默认实现,也可自定义
     */
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return userService.loadUserByUsername(username);
    }
}
